<?php

Route::name('admin_')->prefix('admin')->middleware('admin.auth')->group(function() {

    //
    Route::any('/report/data','MemberController@reportData')->name('report_data');

    Route::any('/report/everyday','ReportController@everyday')->name('report_everyday');
    Route::any('/api/report/everyday','ReportController@doEveryday')->name('api_report_everyday');

    // 会员
    Route::get('/member', 'MemberController@index')->name('member');
    Route::get('/api/member', 'MemberController@all')->name('all_member');
    Route::get('/oli_card/user_card', 'OilCardController@userCard')->name('user_card');

    Route::get('/member/map', 'MemberController@map')->name('user_map');
    Route::get('/member/map/data', 'MemberController@mapdata')->name('user_map_data');

    Route::get('/member/coupon','MemberController@couponList')->name('member_coupon');
    Route::any('/api/member/coupon','MemberController@searchCouponList')->name('api_member_coupon');
    Route::any('/api/member/coupon/send','MemberController@sendCoupon')->name('api_member_coupon_send');

    Route::get('/api/channels_kv','RechargeOrderController@channelsKV')->name('api_channels_kv');

    Route::get('/oil_card', 'OilCardController@index')->name('member_oil_card');
    Route::get('/api/oil_card', 'OilCardController@all')->name('all_member_oil_card');

    Route::get('/recharge_order', 'RechargeOrderController@index')->name('recharge_order');
    Route::get('/recharge_direct_order', 'RechargeOrderController@direct')->name('recharge_direct_order');
    Route::get('/recharge_order/change_card', 'RechargeOrderController@changeCard')->name('change_card');
    Route::get('/api/recharge_order', 'RechargeOrderController@all')->name('all_recharge_order');

    Route::post('/api/recharge_order/refund','RechargeOrderController@doRefund')->name('api_recharge_order_refund');
    Route::post('/api/recharge_order/cancel','RechargeOrderController@doCancel')->name('api_recharge_order_cancel');

    Route::get('/recharge_order_map', 'RechargeOrderController@map')->name('recharge_order_map');
    Route::get('/api/recharge_order_map/data', 'RechargeOrderController@mapdata')->name('recharge_order_map_data');

    Route::get('/mobile_recharge_order', 'MobileRechargeOrderController@index')->name('mobile_recharge_order');
    Route::get('/mobile_recharge_direct_order', 'MobileRechargeOrderController@direct')->name('mobile_recharge_direct_order');
    Route::get('/api/mobile_recharge_order', 'MobileRechargeOrderController@all')->name('mobile_all_recharge_order');



    Route::get('/article', 'ArticleController@index')->name('article');
    Route::get('/api/article', 'ArticleController@all')->name('all_article');
    Route::get('/api/qa', 'ArticleController@category')->name('api_qa');
    Route::get('/api/qa/{id}', 'ArticleController@article')->name('api_qa_id');
    Route::post('/api/article', 'ArticleController@store')->name('api_article');
    Route::put('/api/article/{id}', 'ArticleController@update')->name('put_api_article');
    Route::delete('/api/article/{id}', 'ArticleController@destroy')->name('delete_api_article');

    Route::get('/recharge', 'RechargeController@index')->name('recharge');
    Route::get('/api/recharge', 'RechargeController@all')->name('get_api_recharge');
    Route::post('/api/recharge', 'RechargeController@store')->name('post_api_recharge');
    Route::put('/api/recharge/{id}', 'RechargeController@update')->name('put_api_recharge');
    Route::delete('/api/recharge/{id}', 'RechargeController@destroy')->name('delete_api_recharge');

    Route::get('/mobile_recharge', 'MobileRechargeController@index')->name('mobile_recharge');
    Route::get('/api/mobile_recharge', 'MobileRechargeController@all')->name('get_api_mobile_recharge');
    Route::post('/api/mobile_recharge', 'MobileRechargeController@store')->name('post_api_mobile_recharge');
    Route::put('/api/mobile_recharge/{id}', 'MobileRechargeController@update')->name('put_api_mobile_recharge');
    Route::delete('/api/mobile_recharge/{id}', 'MobileRechargeController@destroy')->name('delete_api_mobile_recharge');


    Route::get('/coupon', 'CouponController@index')->name('coupon');
    Route::get('/api/coupon', 'CouponController@all')->name('get_api_coupon');
    Route::post('/api/coupon', 'CouponController@store')->name('post_api_coupon');
    Route::put('/api/coupon/{id}', 'CouponController@update')->name('put_api_coupon');
    Route::delete('/api/coupon/{id}', 'CouponController@destroy')->name('delete_api_coupon');

    Route::get('/page', 'PageController@index')->name('page');
    Route::get('/api/page', 'PageController@all');
    Route::post('/api/page', 'PageController@store');
    Route::put('/api/page/{id}', 'PageController@update');
    Route::delete('/api/page/{id}', 'PageController@destroy');

    Route::get('/banner', 'BannerController@index')->name('banner');
    Route::get('/api/banner', 'BannerController@all')->name('get_api_banner');
    Route::post('/api/banner', 'BannerController@store')->name('post_api_banner');
    Route::put('/api/banner/{id}', 'BannerController@update')->name('put_api_banner');
    Route::delete('/api/banner/{id}', 'BannerController@destroy')->name('delete_api_banner');


    Route::get('/activity', 'ActivityController@index')->name('activity');
    Route::get('/api/activity', 'ActivityController@all')->name('get_api_activity');
    Route::post('/api/activity', 'ActivityController@store')->name('post_api_activity');
    Route::put('/api/activity/{id}', 'ActivityController@update')->name('put_api_activity');
    Route::delete('/api/activity/{id}', 'ActivityController@destroy')->name('delete_api_activity');

    Route::get('/push/message','PushController@search')->name('push_message');
    Route::get('/api/push/message','PushController@doSearch')->name('api_push_message');
    Route::post('/api/push/message/send','PushController@send')->name('api_push_message_send');
    Route::post('/api/push/message/add','PushController@add')->name('api_push_message_add');
    Route::post('/api/push/message/update','PushController@update')->name('api_push_message_update');
    Route::post('/api/push/message/delete','PushController@delete')->name('api_push_message_delete');

    Route::get('/sms/message','SmsController@search')->name('sms_message');
    Route::get('/api/sms/message','SmsController@apiSearch')->name('api_send_message');
    Route::post('/api/sms/message/add','SmsController@add')->name('api_send_message_add');
    Route::post('/api/sms/message/delete','SmsController@delete')->name('api_send_message_delete');

    Route::get('/api/get/oil_card','OilCardPullController@search')->name('oilcard_get');
    Route::any('/api/card/order/search','OilCardPullController@apiSearch')->name('api_card_order_search');
    Route::put('/api/card/order/update/{id}','OilCardPullController@update')->name('api_card_order_update');
    Route::any('/api/card/export','ExcelController@export')->name('api_card_export');

    Route::get('/api/card/oil_card_list','CompanyOilCardController@search')->name('oilcard_list');
    Route::any('/api/card/search','CompanyOilCardController@apiSearch')->name('api_card_data');
    Route::post('/api/card/add','CompanyOilCardController@apiAdd')->name('api_card_add');
    Route::post('/api/card/update','CompanyOilCardController@apiUpdate')->name('api_card_update');
    Route::post('/api/card/delete','CompanyOilCardController@apiDelete')->name('api_card_delete');


    Route::get('/welfare/list','WelfareController@search')->name('welfare_search');
    Route::any('/api/welfare/search','WelfareController@apiSearch')->name('api_walfare_list');
    Route::post('/api/welfare/add','WelfareController@apiAdd')->name('api_walfare_add');
    Route::post('/api/welfare/update','WelfareController@apiUpdate')->name('api_walfare_update');
    Route::post('/api/welfare/delete','WelfareController@apiDelete')->name('api_walfare_delete');

    Route::get('/api/mayday/search','MayController@search')->name('mayday_search');
    Route::any('/api/mayday/list','MayController@apiSearch')->name('api_mayday_list');


    Route::get('/configure', 'ConfigureController@index')->name('configure');
    Route::put('/configure', 'ConfigureController@update')->name('update_configure');

    Route::get('/admin_operation_record', 'ConfigureController@record')->name('admin_operation_record');
    Route::get('/api/admin_operation_record', 'ConfigureController@searchRecord')->name('api_admin_operation_record');

    Route::get('/app/control', 'AppController@index')->name('app_control');
    Route::get('/api/app/control', 'AppController@all')->name('api_app_control');
    Route::post('/api/app/control/add', 'AppController@add')->name('api_app_control_add');
    Route::post('/api/app/control/fast_update', 'AppController@updateBool')->name('api_app_control_fast_update');
    Route::post('/api/app/control/update', 'AppController@update')->name('api_app_control_update');
    Route::post('/api/app/control/delete', 'AppController@delete')->name('api_app_control_delete');


    Route::get('/goods/search','GoodsController@search')->name('goods_search');
    Route::any('/api/goods/search','GoodsController@apiSearch')->name('api_goods_search');
    Route::any('/api/goods/add','GoodsController@apiAdd')->name('api_goods_add');
    Route::any('/api/goods/update','GoodsController@apiUpdate')->name('api_goods_update');
    Route::any('/api/goods/delete','GoodsController@apiDelete')->name('api_goods_delete');

    Route::get('/goods/class/search','GoodsController@searchClass')->name('goods_class_search');
    Route::any('/api/goods/class/search','GoodsController@apiSearchClass')->name('api_goods_class_search');
    Route::any('/api/goods/childclass/search','GoodsController@apiChildClass')->name('api_goods_childclass_search');
    Route::any('/api/goods/class/add','GoodsController@apiAddCategory')->name('api_goods_class_add');
    Route::any('/api/goods/class/update','GoodsController@apiUpdateCategory')->name('api_goods_class_update');
    Route::any('/api/goods/class/delete','GoodsController@apiDeleteCategory')->name('api_goods_class_delete');
    Route::any('/api/goods/sku/delete','GoodsController@apiDeleteGoodsSku')->name('api_goods_sku_delete');


    Route::get('/nav/search','NavController@search')->name('nav_search');
    Route::any('/api/nav/search','NavController@apiSearch')->name('api_nav_search');
    Route::any('/api/nav/add','NavController@apiAdd')->name('api_nav_add');
    Route::any('/api/nav/update','NavController@apiUpdate')->name('api_nav_update');
    Route::any('/api/nav/delete','NavController@apiDelete')->name('api_nav_delete');

    Route::get('/advs/search','AdvsController@search')->name('advs_search');
    Route::any('/api/advs/search','AdvsController@apiSearch')->name('api_advs_search');
    Route::any('/api/advs/add','AdvsController@apiAdd')->name('api_advs_add');
    Route::any('/api/advs/update','AdvsController@apiUpdate')->name('api_advs_update');
    Route::any('/api/advs/delete','AdvsController@apiDelete')->name('api_advs_delete');
    Route::any('/api/advs/options','AdvsController@apiOptions')->name('api_advs_options');

    /**
     * 活动
     */
    Route::get('/notice/search','NoticeController@search')->name('notice_search');
    Route::any('/api/notice/search','NoticeController@apiSearch')->name('api_notice_search');
    Route::any('/api/notice/add','NoticeController@apiAdd')->name('api_notice_add');
    Route::any('/api/notice/update','NoticeController@apiUpdate')->name('api_notice_update');
    Route::any('/api/notice/delete','NoticeController@apiDelete')->name('api_notice_delete');
    Route::any('/api/notice/options','NoticeController@apiOptions')->name('api_notice_options');

    Route::get('/news/search','NewsController@search')->name('news_search');
    Route::any('/api/news/search','NewsController@apiSearch')->name('api_news_search');
    Route::any('/api/news/add','NewsController@apiAdd')->name('api_news_add');
    Route::any('/api/news/update','NewsController@apiUpdate')->name('api_news_update');
    Route::any('/api/news/delete','NewsController@apiDelete')->name('api_news_delete');


    Route::get('/goods/order/search','GoodsOrderController@search')->name('goods_order_search');
    Route::any('/api/goods/order/search','GoodsOrderController@apiSearch')->name('api_goods_order_search');


    Route::get('/api/recharge_task', 'RechargeOrderController@task')->name('recharge_task');
    Route::get('/recharge_task_fail', 'RechargeOrderController@failTask')->name('recharge_task_fail');
    Route::get('/recharge_task_schedule', 'RechargeOrderController@schoduleTask')->name('recharge_task_schedule');
    Route::post('/api/recharge_task/{id}/try', 'RechargeOrderController@tryRecharge')->name('recharge_task_try');
    Route::get('/api/recharge_task_order', 'RechargeOrderController@scheduleTaskOrder')->name('recharge_task_order');
    Route::post('/api/recharge_task/hand', 'RechargeOrderController@handRecharge')->name('recharge_task_hand');
    Route::any('/api/order/export','ExcelController@rechargeOrderExports')->name('recharge_task_export');

    Route::get('/api/mobile/recharge_task', 'MobileRechargeOrderController@task')->name('mobile_recharge_task');
    Route::get('/mobile/recharge_task_fail', 'MobileRechargeOrderController@failTask')->name('mobile_recharge_task_fail');

    Route::post('/api/handle_recharge', 'RechargeOrderController@handleRecharge')->name('handle_recharge');

    Route::get('/channel', 'MemberController@channel')->name('channel');

    Route::post('/api/member', 'MemberController@store')->name('member_store');

    Route::post('/api/call_mobile', 'PushController@call')->name('call_mobile');

    Route::any('/api/wuliu','GoodsOrderController@apiWuliu')->name('wuliu');

});